import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'home_page.dart'; // 引入新的主页

void main() async {
  // 确保 WidgetsBinding 已初始化
  WidgetsFlutterBinding.ensureInitialized();
  // 在运行应用前加载 .env 文件
  await dotenv.load(fileName: ".env");
  
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '健康数据',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      // 将应用的首页指向新的 HomePage
      home: const HomePage(),
    );
  }
}
